<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Xppass Administrator's Control Panel</title>
<LINK href="<?php echo $www_site_url?>/public/yav-style.css" type=text/css rel=stylesheet>
<script src="<?php echo $www_site_url?>/public/js/common.js" type="text/javascript"></script>
<script src="<?php echo $www_site_url?>/public/js/yav2.0/yav.js"></script>
<script src="<?php echo $www_site_url?>/public/js/yav2.0/yav-config-<?php echo $selected_lang?>.js"></script>
<script src="<?php echo $www_site_url?>/public/js/ajax.js"></script>
</head>
<body><div id="append"></div>
<div id="msg" style="color:red;text-align:center"></div>

    <div class="container">

            <table width="100%" border="0" cellspacing="0" cellpadding="0">
      

        <tr>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td class="table2LeftBorder"></td>
              <td><table width="100%" border="0" cellspacing="10" cellpadding="0">

                <tr>
                  <td width="9%"><img src="/public/upload/faceimg/<?php echo $msg['face_img']?>" width="50" height="50" /></td>
                  <td width="69%"><strong><?php if($msg['from_user_id']==$user['user_id']) echo '我'; else echo $msg['from_user_nickname']?>：</strong><br />

                    <?php echo nl2br($msg['m_content'])?></td>
                  <td width="22%"><?php echo $msg['m_date']?></td>
                </tr>
               <?php if(isset($reply_data) && is_array($reply_data)){
							foreach ($reply_data as $v){?>	
							 <tr>
                  <td><img src="/public/upload/faceimg/<?php echo $v['face_img']?>" width="50" height="50" /></td>
                  <td><strong><?php echo $v['from_user_nickname']?>：</strong><br />
                    <?php echo nl2br($v['m_content'])?></td>

                  <td><?php echo $v['m_date']?></td>
                  </tr>
               
              <?php }
						}?> 
               
                  
                  
              </table>
                <br />
                <br />
                <form name="msgform" id="msgform" method="post" onsubmit="return checkOnSubmit('msgform', rules);" >
                    <input type="hidden" name="action" value="msgbox" />
                    <input type="hidden" name="op" value="reply" />
                    <input type="hidden" name="msg_id" value="<?php echo $msg['m_id']?>" />
                <table width="100%" border="0" cellspacing="10" cellpadding="0">
                  <tr>

                    <td width="10%" valign="top" align="right"><?php echo lang('reply')?></td>
                    <td width="90%">
                      <textarea name="reply" id="reply" cols="70" rows="5" style="border:#666666 solid 1px;"></textarea>
                      <div id="errorsDiv_reply"></div> </td>
                  		  
                       </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>

                      <input name="button" type="submit" class="btn" id="button" value="<?php echo lang('send');?>" />
                    </td>
                  </tr>
                </table>
                
                </form>
                </td>
              <td class="table2RightBorder"></td>
            </tr>
            <tr>
              <td class="table2BottomLeft"></td>
              <td class="table2Bottom"></td>

              <td class="table2BottomRight"></td>
            </tr>
          </table></td>
        </tr>
      </table>
    
<SCRIPT>
//only for test purposes
function checkOnSubmit(formName, r) {
  
    if (yav.performCheck(formName, r, 'inline')) {
    	
		var url = "<?php echo $www_site_url?>/admin.php";
		var params = mini.form.serialize($(formName));
		mini.ajax.post(url, function(r){
			var r = eval('(' + r + ')');  
			alert(r.d) ;
			if(r.s==200){
				window.location.replace(r.d);
			}
			if(r.s==400){
				if(r.m=='reload') window.location.reload();
				else $('msg').innerHTML = r.m;			
			}
		}, params);
    	
    	return false;
    } 
    return false;
}
var rules=new Array();

rules[0]='reply|required|请输入内容';

yav.addHelp('reply', '');
window.onload = function()
                {
                	yav.init('msgform', rules);
                          // Not coming here at all on first shot   
                }


</SCRIPT>   

	</div>

</body>
</html>
